﻿using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using WD.Web.MVC.Controllers.Filters;
using WD.Db.Contract;

namespace WD.Web.MVC.Controllers
{
    public class ApiUserController : ApiController
    {
        /// <summary>
        /// 获取用户信息
        /// </summary>
        /// <param name="id">用户ID</param>
        /// <returns></returns>
        [HttpPost]
        [BasicAuthenticationAttribute]
        public JObject getUser(int id)
        {
            var us = new List<User>();
            us.Add(new User() { UserId = "1", userPhone = "11111" });
            us.Add(new User() { UserId = "2", userPhone = "22222" });
            us.Add(new User() { UserId = "3", userPhone = "33333" });

            ApiResult ajax = new ApiResult();
            ajax.Data = us;
            return ajax.Suc("操作成功");
        }
    }
}
